package com.tmxk.spring;


import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestApplicationContext01 {
    public static void main(String[] args) {
        // 通过ClassPathXmlApplicationContext()解析spring核心配置文件
        ApplicationContext application = new ClassPathXmlApplicationContext("applicationContext.xml");
        //通过application核心配置文件实例构建BeanFactory工厂中的Bean实例( Spring中的工厂模式)
        SysRole sysRole = (SysRole) application.getBean("role");
        System.out.println("sysRole:" + sysRole);

        System.out.println(application.getBean("sysRole"));
    }
}
